package com.xxg.conf;


import com.xxg.curd.annotation.TableField;
import com.xxg.curd.annotation.TableName;
import com.xxg.curd.impl.AbstractCurdConfigImpl;

import java.util.Arrays;
import java.util.List;

/**
 * 数据库配置
 */
public class CurdConfigImpl extends AbstractCurdConfigImpl {

    static final String DRIVER = "com.mysql.cj.jdbc.Driver";
    static final String URL = "jdbc:mysql://115.159.27.224:3306/td_game?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC";
    static final String USER = "root";
    static final String PASS = "396100";


    @Override
    protected String getPassword() {
        return PASS;
    }

    @Override
    protected String getUser() {
        return USER;
    }

    @Override
    protected String getUrl() {
        return URL;
    }

    @Override
    protected String getDriver() {
        return DRIVER;
    }

    @Override
    public List<Class> getMapAnnotation() {
        return Arrays.asList(Prop.class);
    }

    @TableName("game_user_prop")
    static class Prop{
        @TableField("userId")
        Long user;
        @TableField("version")
        Long v;
    }
}


